package com.yingma.common.controller;


import com.yingma.common.util.AjaxResult;
import com.yingma.system.entity.JcVehicle;
import com.yingma.system.service.JcVehicleService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (JcVehicle)表控制层
 *
 * @author makejava
 * @since 2020-03-30 20:10:44
 */
@RestController
@RequestMapping("jcVehicle")
public class JcVehicleController {
    /**
     * 服务对象
     */
    @Resource
    private JcVehicleService jcVehicleService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public JcVehicle selectOne(String id) {
        return this.jcVehicleService.queryById(id);
    }

    /**
     * 根据条件查询信息
     * @param code
     * @param value
     * @param pageNum
     * @param pageSize
     * @return
     */
    @ApiOperation("查询车型信息")
    @RequestMapping(value = "searchvehicle" ,method = RequestMethod.POST)
    public AjaxResult searchVehicleInfo(@ApiParam("车型") String code, @ApiParam("状态") Integer value, @ApiParam("当前页数") Integer pageNum, @ApiParam("每页数量") Integer pageSize){
        List<JcVehicle> list=jcVehicleService.queryBy(code, value, pageNum, pageSize);
        return AjaxResult.success(list);
    }






}
